<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$basic=$this->plugin_setting('basic');
		if(!$basic['isopen']){
			exi('请先启用接口！','error');
		}
		$postdata=get_postdata();
		if(!$postdata['address']){
			exi('请输入地址','error');
		}
		$res=$this->model('api')->getaddress($postdata['address']);
		exi('识别成功,城市：'.$res['city'].',地址：'.$res['detail']);
	}
	$return['item']=$this->plugin_setting('basic');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'测试识别',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'测试识别',
				'list'=>array(
					array('type'=>'tip','title'=>'[温馨提示]：提示No permission to access data？说明没用接口权限，前往百度排查启用！'),
					array('type'=>'text','title'=>'复制要识别的地址','name'=>'address','help'=>'示例：上海市浦东新区纳贤路701号百度上海研发中心 F4A000 张三 15800000000'),
				)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
